package com.tyut.rxtnongyespringboot.service.impl;

import com.tyut.rxtnongyespringboot.bean.User;
import com.tyut.rxtnongyespringboot.mapper.UserMapper;
import com.tyut.rxtnongyespringboot.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


@Service
public class UserServiceimpl implements UserService {


    @Autowired
    private UserMapper userMapper;

    @Override
    public User findByName(String user_name) {
        return userMapper.getUserByuser_name(user_name);
    }

    @Override
    public User insert(User user) {
        userMapper.insertUser(user);
        return user;
    }

    @Override
    public User update(User user) {
        userMapper.updateUser(user);

        return user;
    }
}
